import React from 'react';
import { ModalPro } from '@/components';

type Props = {
  imgUrl: string;
  children: any;
}

class Review extends React.PureComponent<Props> {
  get content() {
    return (
      <div style={{ textAlign: 'center' }}>
        <img
          alt="大图"
          src={this.props.imgUrl}
          style={{ maxWidth: '100%' }}
        />
      </div>
    )
  }

  render() {
    return (
      <ModalPro
        footer={null}
        clone={false}
        title="查看大图"
        triggerContent={this.content}
        children={this.props.children}
      />
    )
  }
}

export default Review;
